add an assert to ensure we do not use virtual file types with no VFS
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Mon, 20 Jan 2025 16:10:09 +0000 (17:10 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 22 Jan 2025 10:17:41 +0000 (11:17 +0100)
if VFS mode is off, we should nto be using any virtual file types

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/discovery.cpp

index e2305a81ee114708606008fb004b48fa3e7e6db5..3b9785a62b32bb490b2ee9ad81bfa9d3080a14dc 100644 (file)
@@ -1712,6 +1712,16 @@ void ProcessDirectoryJob::processFileFinalize(
     } else {
         recurse = false;
     }
+
+    if (!(item->isDirectory() ||
+          (!_discoveryData->_syncOptions._vfs || _discoveryData->_syncOptions._vfs->mode() != OCC::Vfs::Off) ||
+          item->_type != CSyncEnums::ItemTypeVirtualFile ||
+          item->_type != CSyncEnums::ItemTypeVirtualFileDownload ||
+          item->_type != CSyncEnums::ItemTypeVirtualFileDehydration)) {
+        qCCritical(lcDisco()) << "wong item type for" << item->_file << item->_type;
+        Q_ASSERT(false);
+    }
+
     if (recurse) {
         auto job = new ProcessDirectoryJob(path, item, recurseQueryLocal, recurseQueryServer,
             _lastSyncTimestamp, this);